<link rel="stylesheet" href="__MODULE_STATIC__/css/color.css?v={:config('hiphp.version')}">
<style>
    .table-box{
        background-color: #f3f3f3;
        overflow: hidden;
        padding:10px;
    }
    .hi-module-item{
        position: relative;
        overflow: hidden;
    }
    .hi-module-item .layui-card-body {
        height: 80px;
        line-height: 20px;
        overflow: hidden;
        color: #777;
    }
    .hi-module-item .layui-card-header.btns {
        padding: 10px;
        border-top: 1px solid #f6f6f6;
        height: auto;
        overflow: hidden;
    }
    .layui-card-header.btns a{
        color:#fff;
    }

</style>
<div class="table-box">
<div class="layui-form">
    <div class="layui-row layui-col-space5">
        {volist name="dataInfo" id="vo" empty="$emptyTips"}
        <div class="layui-col-md4 hi-module-item">
            <div class="layui-card">
                <div class="layui-card-header">
                    {if isset($vo['icon']) && $vo['icon']}
                    <span><img src="{if request()->param('status') == 4}__MODULE_STATIC__/images/new_icon.png{else}{$vo['icon']}{/if}" width="20" height="20"></span>
                    {elseif request()->param('status') == 4}
                    <span><img src="__MODULE_STATIC__/images/new.png" width="20" height="20"></span>
                    {elseif request()->param('status') == 3}
                    <span><img src="__MODULE_STATIC__/images/upgrade.png" width="20" height="20"></span>
                    {/if}
                    <span>{$vo['title']}</span>
                    <span class="version">{if isset($vo['app_title'])}({$vo['app_title']} / v{$vo['version']} / {if $vo['file_size'] > 1024}{:sprintf('%.2f',$vo['file_size']/1024)}MB{else}{$vo['file_size']}KB{/if}){else}v{$vo['version']}{/if}</span>
                </div>
                {if request()->param('status') != 4}
                <div class="layui-card-body">
                    <p>{$vo['intro']}</p>
                </div>
                {/if}
                {if isset($vo['system']) && $vo['system'] != 1}
                <div class="layui-card-header btns">
                    {switch name="vo['status']"}
                    {case value="-1"}
                    <a href="javascript:;" class="layui-btn hi-bgcolor5 layui-btn-sm site-download-active" uri-params="app_name={$vo['app_name']}&app_type={$vo['app_type']}&app_id={$vo['app_id']}&app_key={$vo['app_key']}&version={$vo['version']}&type={$vo['type']}&size={$vo['file_size']}{if isset($vo['theme_name'])}&theme_name={$vo['theme_name']}{/if}">立即下载</a>
                    {if is_file(public_path().'download/plugin_'.$vo['app_name'].'/download.lock')}
                    <a data-hi-group="plugin_{$vo['app_name']}" class="del-lock-btn layui-btn hi-bgcolor1 layui-btn-sm">删除download.lock</a>
                    {/if}
                    {/case}
                    {case value="0"}
                    <a href="{:url('install',['id'=>$vo['id']])}" class="layui-btn hi-bgcolor1 layui-btn-sm">安装</a>
                    <a data-href="{:url('del',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-sm j-tr-del">删除</a>
                    {/case}
                    {case value="1"}
                    <a href="{:url('status?id='.$vo['id'].'&v=1')}" class="layui-btn hi-bgcolor7 layui-btn-sm">启用</a>
                    <a href="{:url('uninstall?id='.$vo['id'])}" class="layui-btn layui-btn-danger layui-btn-sm">卸载</a>
                    {/case}
                    {case value="2"}
                    {if $vo['theme']}
                    <a href="/plugin.php?s={$vo['name']}" class="layui-btn hi-bgcolor7 layui-btn-sm" target="_blank">前端入口</a>
                    <a href="{:url('theme?id='.$vo['id'])}" class="layui-btn hi-bgcolor9 layui-btn-sm">主题</a>
                    {/if}
                    <a href="{:url('menus?id='.$vo['id'])}" class="layui-btn hi-bgcolor8 layui-btn-sm">更新菜单</a>
                    <a href="{:url('status?id='.$vo['id'].'&v=0')}" class="layui-btn hi-bgcolor4 layui-btn-sm">禁用</a>
                    <a href="{:url('uninstall?id='.$vo['id'])}" class="layui-btn layui-btn-danger layui-btn-sm">卸载</a>
                    {/case}
                    {case value="3"}
                    {if condition="$vo['app_keys']"}
                    <a href="javascript:;" class="layui-btn hi-bgcolor1 layui-btn-sm site-download-active" uri-params="app_name={$vo['app_name']}&app_type={$vo['app_type']}&app_id={$vo['app_id']}&app_key={$vo['app_keys']}&version={$vo['version']}&type={$vo['type']}&size={$vo['file_size']}&op=upgrade{if isset($vo['theme_name'])}&theme_name={$vo['theme_name']}{/if}">更新</a>
                    {/if}
                    {/case}
                    {default /}
                    {/switch}
                </div>
                {else /}
                <button class="layui-btn layui-btn-mini layui-btn-disabled">不可操作</button>
                {/if}
            </div>
        </div>
        {/volist}
    </div>
</div>
</div>
{include file="block/layui" /}
{php}
$status = request()->param('status/d');
{/php}
{if condition="$status == 3 || $status == 4"}
{:runHook('cloud_temp')}
{/if}